//
//  HomeEightSelectTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "HomeEightSelectTableViewCell.h"
#import "UIButton+YLJButtonExtension.h"

@implementation HomeEightSelectTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat jianxiWidth = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(30) - kWidthProportion_In_iPhoneTriploid(65)*4)/3;
        NSArray * titleArr = @[@"求购大厅",@"海量买家",@"找货神器",@"优质店铺",@"钢材资源库",@"行情资讯",@"我的订单",@"钢铁计算器"];
        NSArray * imageArr = @[@"home_one",@"home_two",@"Home_three",@"home_four",@"home_five",@"home_six",@"home_sever",@"home_eight"];
        for (int i=0; i<2; i++) {
            for (int j=0; j<4; j++) {
                GLGWButton * e_but = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(15)+kWidthProportion_In_iPhoneTriploid(65)*j+jianxiWidth*j, i*kHeightProportion_In_iPhoneTriploid(87), kWidthProportion_In_iPhoneTriploid(65), kHeightProportion_In_iPhoneTriploid(75)) titleText:@"" titleLableFont:SYSTEMFONT(12) titleLableColor:kColor_Rule_Black inSuperView:self];
                if (i==0) {
                    e_but.title = titleArr[j];
                    e_but.image_Name = imageArr[j];
                    e_but.tag = 120+j;
                }else{
                    e_but.title = titleArr[j+4];
                    e_but.image_Name = imageArr[j+4];
                    e_but.tag = 124+j;
                }
                [e_but setImagePositionWithType:SSImagePositionTypeTop spacing:kHeightProportion_In_iPhoneTriploid(5)];
                [e_but addTarget:self action:@selector(butAction:) forControlEvents:UIControlEventTouchUpInside];
            }
        }
    }
    return self;
}

-(void)butAction:(GLGWButton *)sender{
    if (self.Block_StellJiSuanQi) {
        self.Block_StellJiSuanQi(sender);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
